home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 050 / fx80.pas < prev    next >
Pascal/Delphi Source File  |  1985-03-24  |  5KB  |  166 lines

  1.  
  2. program FX80;
  3.  
  4. {   This program will control most of the frequently used -- and
  5.  also some infrequently used -- configuration parameters for the
  6.  Epson FX80.  The code compiles 'as is' using TURBO Pascal.  Feel
  7.  free to modify it in any way.  A nice project might be a font
  8.  creation routine.  Please get word to me concerning any changes.
  9.  I'd like to see them.  Go to it!
  10.  
  11.                                   Mark Davis
  12.                                   2315 Mtn Oaks Cir
  13.                                   Birmingham, AL  35226
  14.  
  15.  }
  16.  
  17. type
  18.    Command_type = string[3];
  19.    Prompt_type  = string[30];
  20. var
  21.    Input  : integer;
  22.    Exit   : boolean;
  23.    Esc    : char;
  24.    Command: Command_type;
  25.  
  26. procedure Give_printer(Command: Command_type);
  27.  
  28. {    Sends a string of up to 3 chars to printer }
  29.  
  30.           begin
  31.              write(Lst, Esc, Command);
  32.           end;
  33.  
  34. function Get_parm(Prompt: Prompt_type): integer;
  35.  
  36. {    Returns an integer taken after prompt
  37.      for keyboard input.
  38. }
  39.  
  40. var  parm: integer;
  41.  
  42.          begin
  43.             textcolor(Yellow);
  44.             gotoXY(26,24);
  45.             write(Copy(Prompt,1,Length(Prompt)));
  46.             readln(parm);
  47.             Get_parm := parm;
  48.             gotoXY(26,24);
  49.             ClrEol;
  50.             textcolor(Green);
  51.          end;
  52.  
  53. procedure Scrn_put(X,Y:integer; text:Prompt_type);
  54.  
  55. {    Put a menu line on the screen at X,Y     }
  56.  
  57.          begin
  58.             gotoXY(X,Y);
  59.             writeln(Copy(text,1,Length(text)));
  60.          end;
  61.  
  62. begin
  63.  
  64.      Esc := chr(27);
  65.      textcolor(Yellow);
  66.      textbackground(Black);
  67.      Scrn_put(26,2,'EPSON SETUP PROGRAM');
  68.      textcolor(Green);
  69.      Scrn_put(5,4,' 0 - reset');
  70.      Scrn_put(5,5,' 1 - pica');
  71.      Scrn_put(5,6,' 2 - elite');
  72.      Scrn_put(5,7,' 3 - comp.');
  73.      Scrn_put(5,8,' 4 - emph. pica');
  74.      Scrn_put(5,9,' 5 - dbl-str. pica');
  75.      Scrn_put(5,10,' 6 - dbl-str. elite');
  76.      Scrn_put(5,11,' 7 - dbl-str. comp.');
  77.      Scrn_put(5,12,' 8 - dbl-str. emphasised pica');
  78.      Scrn_put(5,13,' 9 - sngl-str. exp. pica');
  79.      Scrn_put(5,14,'10 - sngl-str. exp. elite');
  80.      Scrn_put(5,15,'11 - sngl-str. exp. comp.');
  81.      Scrn_put(5,16,'12 - sngl-str. emph. exp. pica');
  82.      Scrn_put(5,17,'13 - dbl-str. exp. pica');
  83.      Scrn_put(5,18,'14 - dbl-str. exp. elite');
  84.      Scrn_put(5,19,'15 - dbl-str. exp. comp.');
  85.      Scrn_put(5,20,'16 - dbl-str. emph. exp. pica');
  86.      Scrn_put(40,4,'17 - proportional mode ON');
  87.      Scrn_put(40,5,'18 - proportional mode OFF');
  88.      Scrn_put(40,6,'19 - unidirectional mode ON');
  89.      Scrn_put(40,7,'20 - unidirectional mode OFF');
  90.      Scrn_put(40,8,'21 - half-speed mode');
  91.      Scrn_put(40,9,'22 - normal speed');
  92.      Scrn_put(40,10,'23 - set left margin');
  93.      Scrn_put(40,11,'24 - set right margin');
  94.      Scrn_put(40,12,'25 - set form length');
  95.      Scrn_put(40,13,'26 - set skip over perf.');
  96.      Scrn_put(40,14,'27 - skip over perf OFF');
  97.      Scrn_put(40,15,'28 - select character set');
  98.      Scrn_put(40,16,'29 - n/72 line spacing');
  99.      Scrn_put(40,17,'30 - n/216 line spacing');
  100.      Scrn_put(40,18,'31 - 1/8 line spacing');
  101.      Scrn_put(40,19,'32 - 1/6 line spacing (standard)');
  102.      Scrn_put(40,20,'33 - copy ROM to RAM');
  103.      textcolor(Yellow);
  104.      Scrn_put(28,21,'99 - EXIT TO DOS');
  105.      textcolor(Green);
  106.      Exit := false;
  107.      repeat
  108.      begin
  109.           gotoXY(23,23);
  110.           write('Select option by number: ');
  111.           ClrEol;
  112.           read(Input);
  113.  
  114.           {  parse Input and select output string  }
  115.  
  116.           case Input of
  117.  
  118.               0 : Command := '@';
  119.               1 : Command := '!'+chr(0);
  120.               2 : Command := '!'+chr(1);
  121.               3 : Command := '!'+chr(4);
  122.               4 : Command := '!'+chr(8);
  123.               5 : Command := '!'+chr(16);
  124.               6 : Command := '!'+chr(17);
  125.               7 : Command := '!'+chr(20);
  126.               8 : Command := '!'+chr(24);
  127.               9 : Command := '!'+chr(32);
  128.              10 : Command := '!'+chr(33);
  129.              11 : Command := '!'+chr(36);
  130.              12 : Command := '!'+chr(40);
  131.              13 : Command := '!'+chr(48);
  132.              14 : Command := '!'+chr(49);
  133.              15 : Command := '!'+chr(52);
  134.              16 : Command := '!'+chr(56);
  135.              17 : Command := 'p1';
  136.              18 : Command := 'p0';
  137.              19 : Command := 'U1';
  138.              20 : Command := 'U0';
  139.              21 : Command := 's1';
  140.              22 : Command := 's0';
  141.              23 : Command := 'l'+chr(get_parm('left margin at:'));
  142.              24 : Command := 'Q'+chr(get_parm('right margin at:'));
  143.              25 : Command := 'C'+chr(get_parm('form length: '));
  144.              26 : Command := 'N'+chr(get_parm('number of lines:'));
  145.              27 : Command := 'O';
  146.              28 : Command := 'V+chr(0);
  147.              29 : Command := 'A'+chr(get_parm('n/72 spacing, n = '));
  148.              30 : Command := '3'+chr(get_parm('n/216 spacing, n = '));
  149.              31 : Command := '0';
  150.              32 : Command := '2';
  151.              33 : Command := ':'+chr(0)+chr(0)+chr(0);
  152.              99 : Exit := True;
  153.  
  154.           end; {case}
  155.  
  156.      if not Exit then Give_printer(Command);
  157.  
  158.      end; {until}
  159.  
  160.    until Exit;
  161.  
  162. end.9 : Exit := True;
  163.  
  164.           end; {case}
  165.  
  166.      if not Exit then Give_printer(Command)